import { FC, ReactNode } from "react";
import { NavLink, Route } from "react-router-dom";
type Iprops = {
    to: string
    children: ReactNode
}
const CustomLink: FC<Iprops> = (props) => {
    let { to, children } = props
    return (
        <Route path={to} children={(props:any) => {
            let {match}=props
            // console.log(match);
            
            return (
                <NavLink to={to}>{match?"🍎"+children:children}</NavLink>
            )
        }} />
    )
}

export default CustomLink